<?php 
include "include/lib_func.php";
include "tema/tema1/head.php";
include "tema/tema1/menumember.php";
include "tema/tema1/logodanmenu.php";
include "tema/tema1/wrap.php";

										$link = koneksi_db();
                                        $sql = "select link,p.idmedia,idproduk,nama,namakategori,harga,stok,status,date,diskon from produk p join kategori k on p.idkategori=k.idkategori join media m on p.idmedia=m.idmedia WHERE idproduk= ".$_GET['idproduk'];
                                        $hasil = mysql_query($sql,$link) or exit("Error query: <b>".$sql."</b>.");
										$data1 = mysql_fetch_assoc($hasil);
										
									
  </script>
<script type="text/javascript">
$(document).ready(function() {
	$('.jqzoom').jqzoom({
            zoomType: 'innerzoom',
            preloadImages: false,
			zoomWidth: 300,
            alwaysOn:false
        });
});
</script>
<script type="text/javascript">
$(function() {        
	$("#tab").organicTabs({
  		"speed": 200
	});    
});
</script>                                      
				<div style="clear:both; display:block; height:40px"></div>
                	<div class="prod">
                        <div class="clearfix"> 
                        <a href="admin/server/php/files/<?php echo $data1['link']; ?>" class="jqzoom" rel='gal1'  title="triumph" > <img width="308px" height="320px" src="admin/server/php/files/small_<?php echo $data1['link']; ?>" style="border: 4px solid #e5e5e5;"> </a>
                        </div>
                        <div class="clearfix" >
                            <ul id="thumblist" class="clearfix" >
                              <li>
                              	<a class="zoomThumbActive" href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: '.admin/server/php/files/small_<?php echo $data1['link']; ?>',largeimage: '.admin/server/php/files/<?php echo $data1['link']; ?>'}"><img src='admin/server/php/files/small_<?php echo $data1['link']; ?>'></a>
                              </li>
                              <?php
                              	$link = koneksi_db();
                                        $sql2 = "select link from media m join produk p on p.idmedia=m.idmedia WHERE m.kode= ".$data1['idmedia'];
                                        $hasil = mysql_query($sql2,$link) or exit("Error query: <b>".$sql."</b>.");
										while ($data2 = mysql_fetch_assoc($hasil)) {
										?>
                              <li>
                              	<a class="zoomThumbActive" href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: '.admin/server/php/files/small_<?php echo $data2['link']; ?>',largeimage: '.admin/server/php/files/<?php echo $data2['link']; ?>'}"><img src='admin/server/php/files/small_<?php echo $data2['link']; ?>'></a>
                              </li>
                              <?php
							  }
							  ?>
                              

                            </ul>
                        </div>
                    </div><!--end:prod-->
                    <div class="prod-detail">
                    	<h2><?php echo $data1['nama']; ?></h2>
                        <span class="price"><?php echo $data1['harga']; ?></span> <br />
                         <span class="cart-button"><a href="cart.html">Add to Cart</a></span>
                         <div id="tab">
                            <ul class="nav">
                                <li class="nav-one"><a href="#details" class="current">Deskripsi</a></li>
                                <li class="nav-two"><a href="#specs">Spesifikasi</a></li>
                                <li class="nav-three"><a href="#reviews">Kategori</a></li>
                            </ul>
                            <div class="list-wrap">
                                <div id="details">
                                	<p><?php echo $data1['link']; ?> </p>
                                </div>
                                <ul id="specs" class="hide">
                                    <li><span>Stok:</span><?php echo $data1['stok']; ?></li>
                                    <li><span>Diskon:</span> <?php echo $data1['diskon']; ?></li>
                                    <li><span>Status:</span> <?php echo $data1['status']; ?></li>
                                    <li><span>Tanggal Input:</span> <?php echo $data1['date']; ?></li>
                                </ul>
                                <div id="reviews" class="hide">
									<p><?php echo $data1['namakategori']; ?></p>
                                </div>
                            </div>
                        </div>
                    </div><!--prodetail-->
                   
<?php 
include "produkterbaru.php";
include 'tema/tema1/footer.php';
?>
       